/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */
package co.edu.unal.bioingenium.kbmed.retrieval.vo;

/**
 *
 * @author Alejandro Riveros Cruz Riveros Cruz
 */
public class RelevantDocument implements Comparable<RelevantDocument> {

    /**
     *
     */
    private String documentName;
    /**
     *
     */
    private float similarity;

    /**
     * @param:
     * @return:
     */
    public RelevantDocument() {
        similarity = 0;
    }

    /**
     * @param:
     * @param sim 
     * @return:
     * @param nam 
     */
    public RelevantDocument(String nam, float sim) {
        documentName = nam;
        similarity = sim;
    }

    /**
     * @param:
     * @return:
     * @param rdoc 
     */
    @Override
    public int compareTo(RelevantDocument rdoc) {
        return -Float.compare(similarity, rdoc.getSimilarity());
    }

    /**
     * 
     * @return
     */
    public String getDocumentName() {
        return documentName;
    }

    /**
     * 
     * @param documentName
     */
    public void setDocumentName(String documentName) {
        this.documentName = documentName;
    }

    /**
     * @param:
     * @return:
     * @param sim 
     */
    public void setSimilarity(float sim) {
        similarity = sim;
    }

    /**
     * @param:
     * @return:
     * @return 
     */
    public float getSimilarity() {
        return similarity;
    }

    /**
     * @param:
     * @return:
     */
    @Override
    public String toString() {
        return "Name: " + documentName + " -> Similarity: " + similarity;
    }
}
